//package xin.cymall.listener;
//
//import org.slf4j.Logger;
//import org.slf4j.LoggerFactory;
//import org.springframework.amqp.rabbit.annotation.RabbitListener;
//import org.springframework.beans.factory.annotation.Autowired;
//import org.springframework.messaging.handler.annotation.Payload;
//import org.springframework.stereotype.Component;
//
//import com.fasterxml.jackson.databind.ObjectMapper;
//
//import xin.cymall.entity.SysUser;
//
//@Component
//public class CommonMqListener {
//	private static final Logger log = LoggerFactory.getLogger(CommonMqListener.class);
//
//	@Autowired
//	private ObjectMapper objectMapper;
//
//	/**
//	 * 监听消费用户日志
//	 * 
//	 * @param message
//	 */
//	@RabbitListener(queues = "${log.user.queue.name}", containerFactory = "singleListenerContainer")
//	public void consumeUserLogQueue(@Payload byte[] message) {
//		try {
//			SysUser user = objectMapper.readValue(message, SysUser.class);
//			log.info("监听消费用户日志 监听到消息： {} ", user);
//			// TODO：记录日志入数据表
//			// userLogMapper.insertSelective(user);
//		} catch (Exception e) {
//			e.printStackTrace();
//		}
//	}
//}
